package com.amado.course40Reflect;

import java.util.Date;

/**
 * Created by Administrator on 2018/8/4.
 */
public class S03Common {

	public static void main(String[] args) {
		long param =1;
		User user = new UserImpl();
		System.out.println("入参："+param);
		// 相当于 new Date().getTime();
		new Date().getTime();
		// 执行前时间
		long startTime = System.currentTimeMillis();
		String value = user.getUser(param);
		//执行后时间
		long endTime = System.currentTimeMillis();
		// 执行时间
		System.out.println("耗时MS " + (endTime - startTime));
		
		System.out.println("返回值"+value);
	}

	static class UserImpl implements User {
		@Override
		public String getUser(long id) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("do something");

			return id + "name";
		}
	}
}
